import config from "@/config";
import http from "@/utils/request";

export default {
	page: {
		url: `${config.API_URL}/reworkdoc/pages/`,
		name: "分页",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	ngByPage: {
		url: `${config.API_URL}/reworkdoc/ngbypages/`,
		name: "获取 NG 产品分页信息",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	proclist: {
		url: `${config.API_URL}/reworkdoc/proclist/`,
		name: "获取作业工序信息",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	list: {
		url: `${config.API_URL}/reworkdoc/list/`,
		name: "列表",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	model: {
		url: `${config.API_URL}/reworkdoc/`,
		name: "查询一条",
		get: async function(params){
			return await http.get(this.url + params);
		}
	},
	bysn: {
		url: `${config.API_URL}/reworkdoc/bysn`,
		name: "根据SN查询",
		get: async function(params){
			return await http.get(`${this.url}?sn=${params}`);
		}
	},
	add: {
		url: `${config.API_URL}/reworkdoc/`,
		name: "添加",
		post: async function(data){
			return await http.post(this.url, data);
		}
	},
	update: {
		url: `${config.API_URL}/reworkdoc/`,
		name: "修改",
		put: async function(data){
			return await http.put(this.url, data);
		}
	},
	complete: {
		url: `${config.API_URL}/reworkdoc/complete/`,
		name: "返工完工",
		post: async function(data){
			return await http.post(this.url, data);
		}
	},
	delete: {
		url: `${config.API_URL}/reworkdoc/`,
		name: "删除",
		delete: async function(data){
			return await http.delete(this.url, data);
		}
	}
}
